package com.yili.oa.dao;

import com.yili.oa.models.AllGame;
import com.yili.oa.models.AllGameExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface AllGameMapper {
    @SelectProvider(type=AllGameSqlProvider.class, method="countByExample")
    long countByExample(AllGameExample example);

    @DeleteProvider(type=AllGameSqlProvider.class, method="deleteByExample")
    int deleteByExample(AllGameExample example);

    @Delete({
        "delete from ft_all_game",
        "where game_id = #{gameId,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long gameId);

    @Insert({
        "insert into ft_all_game (game_id, game_name, ",
        "game_status, game_create_time, ",
        "game_xima, game_platform, ",
        "game_kind)",
        "values (#{gameId,jdbcType=BIGINT}, #{gameName,jdbcType=VARCHAR}, ",
        "#{gameStatus,jdbcType=INTEGER}, #{gameCreateTime,jdbcType=TIMESTAMP}, ",
        "#{gameXima,jdbcType=REAL}, #{gamePlatform,jdbcType=BIGINT}, ",
        "#{gameKind,jdbcType=BIGINT})"
    })
    int insert(AllGame record);

    @InsertProvider(type=AllGameSqlProvider.class, method="insertSelective")
    int insertSelective(AllGame record);

    @SelectProvider(type=AllGameSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="game_id", property="gameId", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="game_name", property="gameName", jdbcType=JdbcType.VARCHAR),
        @Result(column="game_status", property="gameStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="game_create_time", property="gameCreateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="game_xima", property="gameXima", jdbcType=JdbcType.REAL),
        @Result(column="game_platform", property="gamePlatform", jdbcType=JdbcType.BIGINT),
        @Result(column="game_kind", property="gameKind", jdbcType=JdbcType.BIGINT)
    })
    List<AllGame> selectByExample(AllGameExample example);

    @Select({
        "select",
        "game_id, game_name, game_status, game_create_time, game_xima, game_platform, ",
        "game_kind",
        "from ft_all_game",
        "where game_id = #{gameId,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="game_id", property="gameId", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="game_name", property="gameName", jdbcType=JdbcType.VARCHAR),
        @Result(column="game_status", property="gameStatus", jdbcType=JdbcType.INTEGER),
        @Result(column="game_create_time", property="gameCreateTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="game_xima", property="gameXima", jdbcType=JdbcType.REAL),
        @Result(column="game_platform", property="gamePlatform", jdbcType=JdbcType.BIGINT),
        @Result(column="game_kind", property="gameKind", jdbcType=JdbcType.BIGINT)
    })
    AllGame selectByPrimaryKey(Long gameId);

    @UpdateProvider(type=AllGameSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") AllGame record, @Param("example") AllGameExample example);

    @UpdateProvider(type=AllGameSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") AllGame record, @Param("example") AllGameExample example);

    @UpdateProvider(type=AllGameSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(AllGame record);

    @Update({
        "update ft_all_game",
        "set game_name = #{gameName,jdbcType=VARCHAR},",
          "game_status = #{gameStatus,jdbcType=INTEGER},",
          "game_create_time = #{gameCreateTime,jdbcType=TIMESTAMP},",
          "game_xima = #{gameXima,jdbcType=REAL},",
          "game_platform = #{gamePlatform,jdbcType=BIGINT},",
          "game_kind = #{gameKind,jdbcType=BIGINT}",
        "where game_id = #{gameId,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(AllGame record);
}